<!DOCTYPE html>
<html lang="en">
<head>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
</head>
<body>
    <div id="app">
        <counter></counter>
        <hr />
        <counter></counter>
    </div>
    <template id="counter">
        <div>
            <button @click="add">add</button>
            <h3>count:{{count}}</h3>
        </div>
    </template>
    <script>
        var data0bj={
        count:0
        }
        Vue.component('counter',{
            template:'#counter',
            data:function(){
                return data0bj
            },
            methods:{
                add(){
                    data0bj.count++
                }
            },
        })
        var app=new Vue({
            el:'#app',
        });
    </script>

</body>
</html>